/*  This program performs the analysis for "House Price Fluctuations: The Role of Housing Wealth as Borrowing Collateral."   The initial part of the
program sets up the sample and necessary variables, and then the code is broken into different segments (denoted by flags) to run different parts
of the analysis.  Relevant comments for regarding running the code are included throughout.  
Since some of the data is proprietary, there are also notes as to what can and cannot be run without first obtaining the additional geographic indentifiers from the PSID. 
The initial dataset read into the program is generated by datasetup.do (also available).
*/




drop _all
clear matrix
clear mata
set memory 2g
set more off
set matsize 10000
set maxvar 20000



use ~/restat_rev/data/revdat_419_wmdebt_fin



* "annualize" imputed non-housing expenditures 

drop ln_rnhcons
replace rnhcons = rnhcons/5 if year <=1999
replace rnhcons = rnhcons/2 if year >1999
gen ln_rnhcons = log(rnhcons)

* construct log levels of imputed CEX based consumption measures; per capita and not

gen rnhcons_pc      = rnhcons/famsize
gen ln_rnhcons_pc     = log(rnhcons_pc)

replace ln_famincrat = log(famincrat) if year ==1997


* food consumption is not available in the PSID in 1988 or 1989 so the CEX data cannot be 
* imputed following BPP's (2006) method so pull backward the data from 1990 to use in 1989

sort unique year
by unique:  replace cons_ndbpp_adj = cons_ndbpp_adj[_n+1] if year ==1989 & year == year[_n+1] -1


* set up a few other needed variables

* log per capita income
gen lnypp = log(YPP)
* age squared and age cubed
gen age2 = ageh^2
gen age3 = ageh^3


* set up the wealth-to-income ratios

* the difference between l_totalfw and l_totalfw1 is that in "1" people with 
* no data for a given wealth category have the amount set to missing rather than 0 (totalfw)
* the "l25" lag is 2 years for the biennial data and 5 years for the  pre-1999 data ---taking
* into account the availability of the wealth data;  a "l2" lag generates everything lagged 2 periods 
* regardless of the year.


gen fwr = l_totalfw/famincrat
gen fwr1 = l_totalfw1/famincrat
gen hewr = l25_rhequity/famincrat
gen dewr = l25_rrpmort/famincrat

gen hwr = l_rhvalue/famincrat


* TRIM OUTLIERS

drop if region >4 | ageh ==999 


* calculate percentiles for trimming outliers

_pctile fwr, percentiles(1(98)99)

gen  fmin = r(r1)
gen  fmax = r(r2)

_pctile hewr, percentiles(1(98)99)

gen  hemin = r(r1)
gen  hemax = r(r2)


_pctile dewr, percentiles(1(98)99)

gen  demin = r(r1)
gen  demax = r(r2)


_pctile fwr1, percentiles(1(98)99)

gen  f1min = r(r1)
gen  f1max = r(r2)

_pctile ln_rnhcons, percentiles(1(98)99)

gen  cmin = r(r1)
gen  cmax = r(r2)

_pctile ln_famincrat, percentiles(1(98)99)

gen  ymin = r(r1)
gen  ymax = r(r2)

_pctile dl_le2_labincr_adj, percentiles(1(98)99)

gen  ygmin = r(r1)
gen  ygmax = r(r2)

_pctile dl_labincr_adj, percentiles(1(98)99)

gen  ygmin1 = r(r1)
gen  ygmax1 = r(r2)


_pctile dl_le2_hlabincr, percentiles(1(98)99)

gen  yghmin = r(r1)
gen  yghmax = r(r2)

*  For now trim consumption,  Other variables are trimmed in the specific regressions;

drop if ln_rnhcons < cmin | ln_rnhcons >cmax | ln_famincrat <ymin | ln_famincrat >ymax




sort unique year


* generate lagged LTV values based on the survey year, given the timing of the regressions.

#delimit ;
by unique:  gen     lltv = ltv[_n-1];
by unique:  replace lltv = ltv[_n-4] if year ==1999 & year == year[_n-4]+5;   *  have one skipped year (1998) b/c have dropped heads;
by unique:  replace lltv = ltv[_n-5] if year <1999 & year == year[_n-5]+5;

gen lltvh = 1 if lltv >.8 & lltv <2;
replace lltvh = 0 if lltv <=.8 & lltv >0;


drop if ltv >2;

* setup indicator variables;

xi year;
xi region;
xi famsize;
xi coh;
xi state;


* FLAGS for running different pats of the code;

*BASELINE (TABLES 4 and 5 from paper, Table A.7 from the appendix);
*INTERACTIONS (TABLES 6 and 7 from paper, Table A.8 from the appendix);
*SUMSTATS (TABLES 1 and 2 and 3);

local baseline = 0;
local interactions = 1;
local sumstat = 0;



gen lnfoodr = log(rfood);



if `baseline' {;

*NOTE:  yppgf yppg R (income growth per capita (ahead), income growth per capita and the unemployment rate (MSA levels)) 
are used in the baseline specifications generated using data the PSID GEOCODE data that must be obtained via a restricted data contract from
the PSID.  The code can be run as is excluding these data.  These data are NOT used after the baseline results;


qui tab year, gen(y);


* BASELINE Equations (TABLE 4 in published paper);

*replace yppgf = yppgf -1;


xtset unique year;

xtreg ln_rnhcons ln_famincrat famsize ageh age2 age3 ib1989.year  i.state
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb1;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year  i.state
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb2;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj  i.state
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb3;


xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj  i.state lnypp
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb4;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj  i.state R
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb5;


xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj  i.state yppg
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb6;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj  i.state yppgf
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb7;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj  i.state yppgf yppg R lnypp
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb8;


estout    bb1 bb2 bb3 bb4 bb5 bb6 bb7 bb8 using ~/restat_rev/results/baseline_cc_alt2.tex, replace margin style(tex) starlevels(* 0.10 ** 0.05 ***
0.01) cells(b(star fmt(%5.2fc)) se(par fmt(%5.2fc)))  keep (ln_famincrat fwr hewr dl_le2_labincr_adj lnypp R yppg yppgf
 )   stats(N r2_a rmse, fmt(%5.0f %5.2f %5.2f))
  varlabels(ln_famincrat "Log Income" fwr "(Financial Wealth)/Income" hewr "(Housing Wealth)/Income"
		dl_le2_labincr_adj "Expected Labor Income Growth"
        lnypp "MSA Income (p.c.)" R "MSA Unemployment Rate"  yppg "MSA Income Growth (p.c)"  yppgf "Expected MSA Income Growth (p.c)")     varwidth(45);




* timing of results (TABLE 5);





xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store tt1;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & year <=1999, fe robust;
estimates store tt2;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & year >1999, fe robust;
estimates store tt3;

* SWTICH to alternative timing for measuring housing equity

replace hewr = lalt_rhequity/famincrat;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 , fe robust;
estimates store tt4;



xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & year <=1999, fe robust;
estimates store tt5;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & year >1999, fe robust;
estimates store tt6;










estout   tt1 tt2 tt3 tt4 tt5 tt6  using ~/restat_rev/results/baseline_cc_timing.tex, replace margin style(tex) starlevels(* 0.10 ** 0.05 ***
0.01) cells(b(star fmt(%5.2fc)) se(par fmt(%5.2fc)))  keep (ln_famincrat fwr hewr dl_le2_labincr_adj
 )   stats(N r2_a rmse, fmt(%5.0f %5.2f %5.2f))
  varlabels(ln_famincrat "Log Income" fwr "(Financial Wealth)/Income" hewr "(Housing Equity)/Income [HEY]"
		dl_le2_labincr_adj "Expected Labor Income Growth"
        lnypp "MSA Income (p.c.)" R "MSA Unemployment Rate"  yppg "MSA Income Growth (p.c)"  yppgf "Expected MSA Income Growth (p.c)"
        y1i "HEY*1989" y2i "HEY*1994" y3i "HEY*1999" y4i "HEY*2001" y5i "HEY*2003"  y6i "HEY*2005")     varwidth(45);



* Online appendix TABLE A.7  (OLS ESTIMATES);


reg ln_rnhcons ln_famincrat ib1989.year  i.coh famsize ageh age2 age3 i.state
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 ;
estimates store b1;



reg ln_rnhcons ln_famincrat fwr hewr ib1989.year  i.state  i.coh famsize ageh age2 age3 
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust;
estimates store b2;


reg ln_rnhcons ln_famincrat fwr hewr avg_labincr ib1989.year  i.state   i.coh famsize ageh age2 age3  
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust ;
estimates store b3;


reg ln_rnhcons ln_famincrat fwr hewr dl_le2_labincr_adj avg_labincr ib1989.year  i.state   i.coh famsize ageh age2 age3  
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust ;
estimates store b4;


reg ln_rnhcons ln_famincrat fwr hewr dl_le2_labincr_adj avg_labincr ib1989.year  i.state  i.coh famsize ageh age2 age3  
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust ;
estimates store b4;


reg ln_rnhcons ln_famincrat fwr hewr dl_le2_labincr_adj avg_labincr ib1989.year  i.state   i.coh famsize ageh age2 age3  lnypp
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust ;
estimates store b5;

reg ln_rnhcons ln_famincrat fwr hewr dl_le2_labincr_adj avg_labincr ib1989.year  i.state   i.coh famsize ageh age2 age3  R
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust ;
estimates store b6;

reg ln_rnhcons ln_famincrat fwr hewr dl_le2_labincr_adj avg_labincr ib1989.year  i.state   i.coh famsize ageh age2 age3  yppg
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust ;
estimates store b7;

reg ln_rnhcons ln_famincrat fwr hewr dl_le2_labincr_adj avg_labincr ib1989.year  i.state   i.coh famsize ageh age2 age3  yppgf
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust ;
estimates store b8;

reg ln_rnhcons ln_famincrat fwr hewr dl_le2_labincr_adj avg_labincr ib1989.year  i.state   i.coh famsize ageh age2 age3  yppg R lnypp yppgf
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, robust ;
estimates store b9;

estout    b1 b2 b3 b4 b5 b6 b7 b8 b9 using ~/restat_rev/results/baseline_cc_alt2.tex, append margin style(tex) starlevels(* 0.10 ** 0.05 ***
0.01) cells(b(star fmt(%5.2fc)) se(par fmt(%5.2fc)))  keep (ln_famincrat fwr hewr dl_le2_labincr_adj avg_labincr lnypp R yppg yppgf
 )   stats(N r2_a rmse, fmt(%5.0f %5.2f %5.2f)) 
  varlabels(ln_famincrat "Log Income" fwr "(Financial Wealth)/Income" hewr "(Housing Wealth)/Income"
		dl_le2_labincr_adj "Expected Labor Income Growth" avg_labincr "Average (permanent) Income" 
        lnypp "MSA Income (p.c.)" R "MSA Unemployment Rate"  yppg "MSA Income Growth (p.c)"  yppgf "Expected MSA Income Growth (p.c)")     varwidth(45);





};










if `interactions' {;




* calculate debt service ratio;
* DSR based on johnson and li (2010);
* assumes paying 2.5% of credit card debt monthly...they also look at DPI;

gen dsr     = (mortpay + lopcar + (.025*w_odebt)*12)/avg_hlabincr_nol;

gen dsr_80 = 0;

#delimit cr
forvalues x= 1999(2)2007 {
centile dsr if year == `x', centile(20(20)80)
replace dsr_80 = r(c_4) if year ==`x'
}

#delimit ;

* use DSR to generate a measure of beginning of period borrowing constraints

sort unique year;

by unique:  gen l_dsr = dsr[_n-1] if year == year[_n-1] +2;
by unique:  gen l_dsr_80 = dsr_80[_n-1] if year == year[_n-1] +2;

gen     l_bc = 1 if l_dsr > l_dsr_80 & l_dsr <=2;
replace l_bc = 0 if l_dsr < l_dsr_80 & l_dsr >0;


* generate some additional needed variables;

*liquid wealth to income;
gen llwy_jl = l_liqw_jl/avg_labincr_nol;
gen llwy    = l_liqw/avg_labincr_nol;


* calculate quartiles for certain variables;

local vars "dl_le2_labincr dl_le2_hlabincr l_dsr l_liqw l_liqw_jl llwy  llwy_jl l_totalfw";

#delimit cr
foreach y of local vars {

_pctile `y' if `y' !=. , percentiles(25(25)75)

gen  i`y'_p1 = r(r1)
gen  i`y'_p2 = r(r2)
gen  i`y'_p3 = r(r3)

gen ips_`y'=1 if `y' !=.
replace ips_`y'=2 if (`y'>i`y'_p1 & `y'<=i`y'_p2) & `y' !=.
replace ips_`y'=3 if (`y'>i`y'_p2 & `y'<=i`y'_p3) & `y' !=.
replace ips_`y'=4 if `y'>i`y'_p3 & `y'!=.	

* also want dummy variable for above and below median of a given variable

gen       am_`y' = 1 if `y'>i`y'_p2  & `y' !=.
replace   am_`y' = 0 if `y'<=i`y'_p2  & `y' !=.

}


#delimit ;

* below median liquid wealth and below median liquid wealth to income variables;
gen bm_lw = 1 if ips_l_liqw <=2;
replace bm_lw = 0 if ips_l_liqw >2 & ips_l_liqw ~=.;

gen bm_lwy = 1 if ips_llwy <=2;
replace bm_lwy = 0 if ips_llwy >2 & ips_llwy ~=.;



* high income;

gen sd1 = sd_d2hlabincr_adj + avg_d2hlabincr_adj ;

gen highy = 1 if ips_dl_le2_labincr ==4;
replace highy = 0 if ips_dl_le2_labincr ~=4 & ips_dl_le2_labincr ~=.;





* TABLE 6;

* using alternative timing for housing equity;
replace hewr = lalt_rhequity/famincrat;


xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65  , fe robust;

estimates store l0;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & year >1999 , fe robust;

estimates store l00;

* prior 1999;
*xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & year <=1999 , fe robust;

*estimates store l00;





* above/below median liquid wealth ;



xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65  & bm_lwy ==1 , fe robust;

estimates store l1;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65  & bm_lwy ==0 , fe robust;

estimates store l2;



* liquid wealth ratio cuts;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65  & bm_lwy ==1 & year >1999, fe robust;

estimates store l3;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65  & bm_lwy ==0 & year >1999, fe robust;

estimates store l4;




xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65  & bm_lwy ==1 & year <=1999, fe robust;

estimates store l3a;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65  & bm_lwy ==0 & year <=1999, fe robust;

estimates store l4a;


* debt-service ratios;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & am_l_dsr ==0, fe robust;

estimates store dlow;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & am_l_dsr ==1, fe robust;

estimates store dhigh;


xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & am_l_dsr ==1 & bm_lwy ==1, fe robust;

estimates store dhigh1;


xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & am_l_dsr ==1 & bm_lwy ==0, fe robust;

estimates store dhigh2;


estout  l0 l00 l1 l2 l3 l4  dlow dhigh dhigh1 dhigh2 l3a l4a using ~/restat_rev/results/interractions_final.out, replace margin style(tex) starlevels(* 0.10 ** 0.05 ***
0.01) cells(b(star fmt(%5.2fc)) se(par fmt(%5.2fc)))  keep (ln_famincrat fwr hewr dl_le2_labincr_adj)   stats(N r2_a rmse, fmt(%5.0f %5.2f %5.2f))
  varlabels(ln_famincrat "Log Income" fwr "(Financial Wealth)/Income" hewr "(Housing Equity)/Income"
		dl_le2_labincr_adj "Expected Labor Income Growth" avg_labincr "Average (permanent) Income"
        lnypp "MSA Income (p.c.)" R "MSA Unemployment Rate"  yppg "MSA Income Growth (p.c)"  yppgf "Expected MSA Income Growth (p.c)")     varwidth(45);













*TABLE 7, PANEL A;

*2001 onward;



xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1 & year >=2001, fe robust;
estimates store y1;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0 & year >=2001, fe robust;
estimates store y2;



xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1 & bm_lwy ==0 & year >=2001 , fe robust;

estimates store yy2;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1 & bm_lwy ==1 & year >=2001, fe robust;

estimates store yy3;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0 & bm_lwy ==0 & year >=2001, fe robust;

estimates store yy4;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0 & bm_lwy ==1 & year >=2001 , fe robust;

estimates store yy5;



estout  y1 y2 yy2 yy3 yy4 yy5  using ~/restat_rev/results/interractions_y.out, replace margin style(tex) starlevels(* 0.10 ** 0.05 ***
0.01) cells(b(star fmt(%5.2fc)) se(par fmt(%5.2fc)))  keep (ln_famincrat fwr hewr dl_le2_labincr_adj )   stats(N r2_a rmse, fmt(%5.0f %5.2f %5.2f))
  varlabels(ln_famincrat "Log Income" fwr "(Financial Wealth)/Income" hewr "(Housing Equity)/Income"
		dl_le2_labincr_adj "Expected Labor Income Growth" avg_labincr "Average (permanent) Income"
        lnypp "MSA Income (p.c.)" R "MSA Unemployment Rate"  yppg "MSA Income Growth (p.c)"  yppgf "Expected MSA Income Growth (p.c)")     varwidth(45);





*TABLE 7 - PANEL B;


* prior 2001 ;

replace hewr = lalt_rhequity/famincrat;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1 & year <2001, fe robust;
estimates store y1;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0 & year <2001, fe robust;
estimates store y2;



xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1 & bm_lwy ==0 & year <2001 , fe robust;

estimates store yy2;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1 & bm_lwy ==1 & year <2001, fe robust;

estimates store yy3;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0 & bm_lwy ==0 & year <2001, fe robust;

estimates store yy4;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0 & bm_lwy ==1 & year <2001 , fe robust;

estimates store yy5;


estout  y1 y2 yy2 yy3 yy4 yy5 using ~/restat_rev/results/interractions_y_pre2001.out, append margin style(tex) starlevels(* 0.10 ** 0.05 ***
0.01) cells(b(star fmt(%5.2fc)) se(par fmt(%5.2fc)))  keep (ln_famincrat fwr hewr dl_le2_labincr_adj )   stats(N r2_a rmse, fmt(%5.0f %5.2f %5.2f))
  varlabels(ln_famincrat "Log Income" fwr "(Financial Wealth)/Income" hewr "(Housing Equity)/Income"
		dl_le2_labincr_adj "Expected Labor Income Growth" avg_labincr "Average (permanent) Income"
        lnypp "MSA Income (p.c.)" R "MSA Unemployment Rate"  yppg "MSA Income Growth (p.c)"  yppgf "Expected MSA Income Growth (p.c)")     varwidth(45);


*  FULL SAMPLE RESULTS, TABLE A.8 SUPPLEMENTARY APPENDIX



xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj  
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1, fe robust;
estimates store y1;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj  
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0, fe robust;
estimates store y2;



xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj 
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1 & bm_lwy ==0 , fe robust;

estimates store yy2;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj 
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==1 & bm_lwy ==1 , fe robust;

estimates store yy3;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj 
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0 & bm_lwy ==0 , fe robust;

estimates store yy4;

xtreg ln_rnhcons ln_famincrat fwr hewr famsize ageh age2 age3 ib1989.year dl_le2_labincr_adj 
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65 & highy ==0 & bm_lwy ==1 , fe robust;

estimates store yy5;


estout  y1 y2 yy2 yy3 yy4 yy5  using ~/restat_rev/results/interractions_y7.out, replace margin style(tex) starlevels(* 0.10 ** 0.05 ***
0.01) cells(b(star fmt(%5.2fc)) se(par fmt(%5.2fc)))  keep (ln_famincrat fwr hewr dl_le2_labincr_adj )   stats(N r2_a rmse, fmt(%5.0f %5.2f %5.2f)) 
  varlabels(ln_famincrat "Log Income" fwr "(Financial Wealth)/Income" hewr "(Housing Equity)/Income"
		dl_le2_labincr_adj "Expected Labor Income Growth" avg_labincr "Average (permanent) Income" 
        lnypp "MSA Income (p.c.)" R "MSA Unemployment Rate"  yppg "MSA Income Growth (p.c)"  yppgf "Expected MSA Income Growth (p.c)")     varwidth(45);














};








#delimit ;

if `sumstat' {;

*NOTE:  SUMMARY STATISTIC CODE CANNOT BE RUN WITHOUT MSA level house price data qhpgrow4 and qhpgrow8 along with  ;
* yppgf yppg R (other MSA income and unemployment data) as discussed in datasetup.do;
*These data can only be merged after obtaining the geographic identifiers via a restricted data contract from the PSID;
*Of course the code can be run as is if the lines referencing these data are commented out.;

*Summary Statistics Table (Tables 1 and 2 and 3 in the paper);


* restrict things to the baseline sample;

xtreg ln_rnhcons ln_famincrat famsize ageh age2 age3 ib1989.year
if moved ==0  & howner ==1  & l_howner ==1 & fwr >fmin & fwr <fmax  & hewr >hemin & hewr <hemax & dl_le2_labincr < ygmax
& dl_le2_labincr >ygmin & ageh <65, fe robust;
estimates store bb1;

gen ins = 1 if e(sample);


* transform and set up some necessary data some necessary data

gen psidc = cons_mergepsid_b/def;
gen psidc_a = pexpn;
replace psidc_a = pexpnf if year >=2005;
gen ndbpp = cons_ndbpp_adj/def;

* move in 1990 data to 1989;

sort unique year;

by unique:  replace ndbpp = ndbpp[_n+1] if year ==1989 & year == year[_n+1] -1;


gen srate1 = rstoth/famincrat;
gen srate2 = rstot/famincrat;

#delimit cr


*want saving with stock market not imputed

local vars "shouse sore sira scash sbond svehic sstk sstki sbusi sodebt"


foreach x of local vars {

gen sr1_`x' = `x'/(faminc5yr) if year <=1999
replace sr1_`x' = `x'/(famincr2yr*def2yr) if year >=2001

}

egen sr1_stot = rowtotal(sr1_shouse sr1_sore sr1_scash sr1_sbond sr1_svehic sr1_sstk sr1_sodebt sr1_sira  sr1_sbusi)
egen sr1a_stot = rowtotal(sr1_shouse sr1_sore sr1_scash sr1_sbond sr1_svehic sr1_sstki sr1_sodebt sr1_sira  sr1_sbusi)


#delimit;
replace srate1 = sr1a_stot ;

_pctile srate1, percentiles(1(98)99);

gen smin = r(r1);
gen  smax = r(r2);

_pctile sr1_stot, percentiles(1(98)99);

gen  smin2 = r(r1);
gen  smax2 = r(r2);



replace srate1 = . if srate1 <smin | srate1 >smax;
replace sr1_stot = . if sr1_stot <smin2 | sr1_stot >smax2;

replace srate1 = srate1*100;
replace sr1_stot = sr1_stot*100;





* calculate debt service ratio;

* debt service ratio based on johnson and li (2010);
* assumes paying 2.5% of credit card debt monthly...they also look at DPI;

gen dsr     = (mortpay + lopcar + (.025*w_odebt)*12)/avg_hlabincr_nol;


gen dsr_80 = 0;

#delimit cr
forvalues x= 1999(2)2007 {
centile dsr if year == `x', centile(20(20)80)
replace dsr_80 = r(c_4) if year ==`x'
}

#delimit ;


sort unique year;

by unique:  gen l_dsr = dsr[_n-1] if year == year[_n-1] +2;
by unique:  gen l_dsr_80 = dsr_80[_n-1] if year == year[_n-1] +2;

gen     l_bc = 1 if l_dsr > l_dsr_80 & l_dsr <=2;
replace l_bc = 0 if l_dsr < l_dsr_80 & l_dsr >0;

gen llwy    = l_liqw/avg_labincr_nol;

* calculate quartiles for certain variables;



local vars "dl_le2_labincr l_dsr llwy ";

#delimit cr
foreach y of local vars {

_pctile `y' if `y' !=. , percentiles(25(25)75)

gen  i`y'_p1 = r(r1)
gen  i`y'_p2 = r(r2)
gen  i`y'_p3 = r(r3)

gen ips_`y'=1 if `y' !=.
replace ips_`y'=2 if (`y'>i`y'_p1 & `y'<=i`y'_p2) & `y' !=.
replace ips_`y'=3 if (`y'>i`y'_p2 & `y'<=i`y'_p3) & `y' !=.
replace ips_`y'=4 if `y'>i`y'_p3 & `y'!=.	

* also want above and below median variable

gen       am_`y' = 1 if `y'>i`y'_p2  & `y' !=.
replace   am_`y' = 0 if `y'<=i`y'_p2  & `y' !=.

}



* TABLE 2 --- Summary Statistics Across Groups;

#delimit ;

gen bm_lwy = 1 if ips_llwy <=2;
replace bm_lwy = 0 if ips_llwy >2 & ips_llwy ~=.;
gen highy = 1 if ips_dl_le2_labincr ==4;
replace highy = 0 if ips_dl_le2_labincr ~=4 & ips_dl_le2_labincr ~=.;



replace yppgf = (yppgf-1)*100;
replace yppg  = (yppg-1)*100;


local vars "highy bm_lwy am_l_dsr";

replace dl_le2_labincr = dl_le2_labincr*100;
replace qhpgrow4 = qhpgrow4*100;
gen permi = exp(avg_labincr);

foreach x of local vars {;
foreach y of numlist 1 0 {;
	estpost sum srate1 ageh famsize yppgf YPP  yppg R qhpgrow4 famincrat llwy lalt_rhequity dl_le2_labincr amtextr avg_labincr_nol
fwr hewr, d qui,
		     if `x' == `y'  & ins==1;
	eststo `x'_`y'a;
};
};


estout highy_1a highy_0a bm_lwy_1a bm_lwy_0a am_l_dsr_1a am_l_dsr_0a
       using ~/restat_rev/table1_types.out, replace cells(mean(fmt(1 ))) style(tex)
       varlabels(srate1 "Saving Rate w/ housing (%)"  ageh   "Age Head" famsize "Family Size" yppgf   "MSA Expected Income Growth (p.c) (%)"
       yppg    "MSA Income Growth (p.c) (%)" YPP     "MSA Income (p.c.)" R       "MSA Unemployment Rate"  qhpgrow4 "MSA House Price Growth (%)"
       famincrat "Disposable Family Income" lalt_rhequity "Housing Equity" llwy "Liquid Wealth-to-Income Ratio" dl_le2_labincr " Expected Labor Income Growth"
       test2 "N") ;



* SUMMARY STATISTICS FULL SAMPLE (TABLE 1);

* make a few adjustments and label variables
replace agew =. if agew ==999 | agew ==0;
gen married100 = (mstatus == 1)*100 if mstatus < .;

label var srate1 "Saving Rate";
label var ageh   "Age Head";
label var famsize "Family Size";
label var yppgf   "MSA Expected Income Growth (p.c) (%)";
label var yppg    "MSA Income Growth (p.c) (%)";
label var YPP     "MSA Income (p.c.)";
label var R       "MSA Unemployment Rate";
label var qhpgrow4 "MSA House Price Growth (%)";
label var famincrat "Disposable Family Income";
label var lalt_rhequity "Housing Equity";
label var l_totalfw     "Financial Wealth";
label var l_liqw_jl     "Liquid Wealth (Cash Holdings)";
label var avg_labincr_nol " ``Normal'' Labor Income";
label var dl_le2_labincr " Expected Labor Income Growth (%)";
label var fwr "Financial Wealth-to-Income Ratio";
label var hewr "Housing Equity-to-Income Ratio";
label var married100 "Married (%)";
label var agew "Age Wife";



sutex srate1 ageh agew married100 famsize yppgf YPP  yppg R qhpgrow4 famincrat l_liqw_jl l_totalfw lalt_rhequity dl_le2_labincr fwr hewr 
if ins ==1 , labels minmax digits(1) file(~/restat_rev/sumstats) replace;

/*
* TABLE 3 was done interactively in stata where "srate1" was summarized by group and then recorded in the tablep;
* for example;

summ srate1 if ins ==1 & highy ==1, d;
summ srate1 if ins ==1 & highy ==0, d;
*/



* Summary statistics for consumption, income and saving data... TABLE A.1;


gen inc_pc = famincrat/famsize;

egen save    = rowtotal(shouse sore scash sbond svehic sstki sodebt sira  sbusi);
gen save_pc = save/famsize;


gen save_pc2 = rstot/famsize;


_pctile save_pc, percentiles(1(98)99);

gen spmin = r(r1);
gen  spmax = r(r2);

_pctile save_pc2, percentiles(1(98)99);

gen spmin2 = r(r1);
gen  spmax2 = r(r2);

replace save_pc  = . if save_pc <spmin | save_pc >spmax;
replace save_pc2 = . if save_pc2 <spmin2 | save_pc2 >spmax2;



* manually enter NIPA data (vintage when the paper was resubmitted)

gen nipas = 10711.96142 if year ==1989;
replace nipas = 10274.99953 if year ==1994;
replace nipas = 7439.28285 if year ==1999;
replace nipas = 7181.032821 if year ==2001;
replace nipas = 9964.070209 if year ==2003;
replace nipas = 4310.854103 if year ==2005;
replace nipas = 7108.683056 if year ==2007;

gen nipai = 23385 if year ==1989;
replace nipai = 24517 if year ==1994;
replace nipai = 27805 if year ==1999;
replace nipai = 29299 if year ==2001;
replace nipai = 30442 if year ==2003;
replace nipai = 31318 if year ==2005;
replace nipai = 32693 if year ==2007;

gen nipasr = 6.6 if year ==1989;
replace nipasr = 5.2 if year ==1994;
replace nipasr = 3.1 if year ==1999;
replace nipasr = 2.7 if year ==2001;
replace nipasr = 3.5 if year ==2003;
replace nipasr = 1.4 if year ==2005;
replace nipasr = 2.1 if year ==2007;




local vars "rnhcons psidc psidc_a  ndbpp inc_pc srate1 srate2 save_pc save_pc2";

#delimit cr

*set up tabling structure

gen test = 0

#delimit ;
foreach x of numlist 1989 1994 1999 2001 2003 2005 2007 {;
    summ rnhcons if year == `x', d ;
    replace test = 	r(N) if year == `x';

    estpost summ rnhcons psidc psidc_a  ndbpp inc_pc srate1 sr1_stot save_pc nipai nipas nipasr test, d qui, 
		     if year == `x' ;
	eststo s`x';
};


* THIS GENERATES DATA FOR BOTH THE UPPER AND LOWER PANELS; 


estout s1989 s1994 s1999 s2001 s2003 s2005 s2007
       using ~/IMFdelever/table1_full.out, replace cells(mean(fmt(0 0 0 0 0 1 1 0 0 0 1 0)) p50(fmt(0 0 0 0 0 1 1 0 0 0 1 0  ))) style(tex)
       varlabels(rnhcons "Non-housing Expenditures (imputed)" psidc "Non-housing Expenditures (imputed-BPP)" psidc_a "PSID Consumption"
		ndbpp "Non-durable Expenditures (imputed-BPP)" inc_pc "Disposable Family Income (p.c.)" srate1 "Saving Rate imputed stock"
        sr1_stot "Saving Rate w/o imputed stock" nipai "NIPA Disposable Income (p.c.)"  nipas "NIPA Personal Saving Rate" save_pc "PSID Saving (p.c.)"
        nipasr "NIPA Personal Saving (p.c.)"  test "N");
		







};





